package com.edu.exam.enums.examination;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 监控状态枚举
 */
@Getter
@AllArgsConstructor
public enum MonitoringStatus {
    ACTIVE("ACTIVE", "活跃"),
    INACTIVE("INACTIVE", "非活跃"),
    SUSPENDED("SUSPENDED", "暂停"),
    STOPPED("STOPPED", "已停止"),
    ERROR("ERROR", "错误"),
    PAUSED("PAUSED", "暂停"),
    COMPLETED("COMPLETED", "已完成"),
    INITIALIZING("INITIALIZING", "初始化中"),
    CONFIGURING("CONFIGURING", "配置中"),
    TESTING("TESTING", "测试中");

    private final String code;
    private final String description;

    public static MonitoringStatus fromCode(String code) {
        for (MonitoringStatus status : values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return INACTIVE; // 默认返回非活跃
    }
}